//
//  Uiview+Controller.swift
//  AcrossAnHui
//
//  Created by 张继强 on 16/10/27.
//  Copyright © 2016年 安徽畅通行. All rights reserved.
//

import Foundation

extension UIView{
   public func getController(view:UIView)->UIViewController?{
        var nextresponse = view.next
        while nextresponse != nil {
            if (nextresponse?.isKind(of: UIViewController.classForCoder()))!{
                return nextresponse as?UIViewController
            }
            nextresponse = nextresponse?.next
        }
        return nil
    }
}
